package com.aaa.controller;

import com.aaa.utils.UploadUtils;
import com.aaa.vo.R;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

@Controller
@RequestMapping("/upload")
public class UploadController {

    @RequestMapping
    @ResponseBody
    public R upload(MultipartFile file) {
        String path = UploadUtils.uploadOss(file);
        return new R(200, "上传成功", path);
    }
}
